from selenium import webdriver
from selenium.webdriver.common.by import By

browser = webdriver.Firefox()
browser.get("https://www.baidu.com/")
try:
    elem = browser.find_element(By.ID, "kw")
    print(elem.tag_name)
    elem.send_keys("togaf")
    elem.submit()
except:
    print('was not able to find')
